package com.gps.web.action;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;

import com.gps.web.entity.system.User;

public class Index {
	public String execute() {
		Configuration conf = new Configuration();
		@SuppressWarnings("deprecation")
		SessionFactory sf= conf.buildSessionFactory();
		Session session = sf.getCurrentSession();
		Transaction transaction = session.beginTransaction();
		
		User user = new User();
		user.setUserID(1);
		user.setUserName("User");
		user.setPassWord("pwd");
		session.save(user);
		
		transaction.commit();
		
		System.out.print("hello");
		return "success";
	}
}
